Two wire communication apparatus and method

ABSTRACT

A method and apparatus for operating and actuating remote devices using a single pair of wires together with communication and networking protocols necessary for operational control of the remote devices and data gathering activities from the remote devices. The invention leverages the use of existing wiring and is particularly useful in heating and air conditioning systems, sprinkler control systems, security systems, lighting control systems, industrial automation control systems and similar environments.

BACKGROUND OF THE INVENTION

[0001] This invention comprises communication and power distributiondesign wherein both the power for operation of remote sensing elementsand remotely actuated elements can be transmitted down a single pair ofwires together with the communication or networking protocols necessaryfor operational control of and data gathering from the remote devices.While the techniques discussed are applicable to many control and datagathering activities, this invention targets control of heating and airconditioning systems, sprinkler control systems, security and lightingcontrols and industrial automation controls.

[0002] Numerous systems exist where a signal of some type is superimposed on a power signal. In these systems, the communicationinformation is separated from the power signal in the frequency spectrumsuch that through proper frequency separation techniques and with properencoding and decoding techniques the information can be extracted fromthe power signal. These systems can perform very well and meet manydesign needs. Systems comprising a high frequency carrier, upon which isimpressed the encoded information, requires a tightly specified andcontrolled transmission medium such that the high frequency carrier isnot lost and signal integrity is maintained. These systems generallytend to require more complex encoding and decoding hardware. If theproper techniques are not used, transmission distances and datatransmission integrity can be limited. If good techniques are used, veryhigh data rates can be achieved.

[0003] In the design center, there are often requirements to useexisting wiring such as in sprinkler systems where it is both costeffective and much less disruptive to the environment to use existingwiring. A typical system may have an individual wire to each valve and acommon ground. This type of lay out is not well suited to high frequencyencoding systems where transmission line characteristics are important.With conventional systems, adding additional valves means installing anew wire for each new valve.

[0004] This two-wire system facilitates expansion by extending theexisting wiring with additional two-wire lengths to reach the newlocations. The two-wire system can be connected in a loop configurationthat provides a redundancy level not available in other topologies. Aloop provides the ability to continue to operate with a single break inthe two-wire loop. In the heating and air conditioning environment, itis often difficult to add wire, and being able to use existingthermostat wiring can be an installation and cost advantage. The sameholds for lighting and security control.

DESCRIPTION OF PRIOR ART

[0005] Fowler (U.S. Pat. No. 4,093,946) in 1976 teaches the fundamentalsof communication over a two wire system and method for interrogating aplurality of data gathering devices for actuation of selected ones fromwhich data is received. Transducers, as taught by Fowler, are typicallyremotely located from the interrogating and receiving apparatus and areconnected via a single two-conductor path over which power is conveyedto the transducers and data signals conveyed between the transducers andthe receiving apparatus. Fowler teaches that turning on current sourceand causing a constant current to be propagated down cable can produce abinary signal. He continues that voltage modulation can be can beinduced by alternately placing a high impedance and a short circuitacross the conductors of the cable, while the current source iscontinuously enabled. The voltage on the cable can be caused toalternate between two binary states.”

[0006] Shimada (U.S. Pat. No. 4,139,737) in 1979 applies the two wirecommunication concept through the addition of a time division multiplextransmission system in which electrical power is transmitted to remoteterminals from a central unit simultaneously with address and controlsignals.

[0007] He also references that adding modulators and demodulators topower lines was well known in 1979. “Alternatively a pair oftransmission lines have been arranged between the central unit and therespective terminal units and, further, modulators and demodulators havebeen inserted between the central unit and the said transmission linesand between the respective terminal units and the transmission lines sothat the address, control, response and the like signals have beensuperposed on electric power waves to be transmitted between the centralunit and the respective terminal units. However, with this arrangement,the modulators and demodulators have been required, the system formationhas been complicated and the cost reduction has not been able to beattained.” This technique is widely used in both AC and DC two wiresystems. Systems with high frequency carriers require special care inimpedance matching and layout and are limited in distance. They alsorequire a certain level of cost and complexity.

[0008] Horn (U.S. Pat. No. 4,208,650) in 1980 teaches the concept ofusing a basic message protocol where “The transmitter is connected to adata containing unit and operates through a data cycle which addressesthe data unit to provide a plurality of serially arranged message framesduring each data cycle. Each message frame includes a marker bit, a syncword, data words having either digital or analog information, addressand error words, a checkword, and various parity and start bits. Thereceiver, which is connected to another data unit, is adapted torecognize each message frame by means of the marker bit and the syncword, and evaluate the message validity by means of the parity and startbits, and the checkword.”

[0009] These four patents clearly teach the following principles and arenow in the public domain:

[0010] 1. Communicating and supplying power over a two-wire system,

[0011] 2. Impressing a current source on a line and causing modulationon the line by sinking that current such that the voltage will fall to alow level where alternating changes between the high and low levels isdetected and decoded by the intended receiver,

[0012] 3. Each message frame includes a marker bit, a sync word, datawords having either digital or analog information, address and errorwords, a checkword, and various parity and start bits.

[0013] There have been significant refinements and variations over theyears including the following. Each variation developed to meet specificrequirements demanded by the projected usage.

[0014] Demeyer, et al. (U.S. Pat. No. 5,089,974) in 1992 teaches artthat is perhaps most similar to ours. Their abstract follows:

[0015] A building power management controller comprises a plurality ofmodules connected by a two-wire network. Each module comprises a datatransceiver device, controlled by a microprocessor, to both transmitdata to the other modules and to a central unit via the two-wirenetwork, and to receive information via this two-wire network. Themodules are supplied with power by the two-wire network. When twomodules transmit simultaneously, one takes priority so as not to disturbthe messages transmitted.

[0016] Demeyer utilizes the concept taught by Fowler above, where acurrent source is applied and an alternate sink and high impedance loadis used to generate the timing for the coding scheme. Demeyer alsoteaches that super imposed communication signals can be handled bysensing an out of phase bit through a comparator means where adifference in state between the output of the transmit bit and the inputfrom the two-wire level sense comparator is sensed. The comparator iswill indicate by an output level if there is a difference between thelines while the module is in the low state. The microcontroller in themodule can sense this level and withdraw from the communication cycleletting the other device continue.

[0017] Demeyer does not teach the ability to use this capability toautomatically configure the system.

[0018] Our invention varies substantially by teaching the follow:

[0019] 1. Independent physical modules capable of being assigned aplurality of addresses with each address independently associate to anindependent prescribed function, such that all functions are addresseddirectly. Thus new modules with combinations of functions can beintroduced without causing changes to the controlling application anduser interface.

[0020] 2. Each function will perform or report the prescribed functionindependent of the other functions in the physical module.

[0021] 3. Each function will share the interface means for the physicalmodule as well as the microcontroller means.

[0022] 4. Collision detection means for detecting multiple responses onthe two-wire buss with each function backing off tee function'scommunication attempt until only one function continues to communicate,thus guaranteeing a response. This capability is uniquely used toautomatically determine the components and functions currently connectedto the network. The network can be given a global command to allfunctions to report all serial numbers. Each attached remote device willattempt to answer. As each device answers, the remote checks for aresponse from other device on the two-wire interface. If it detects aresponse from another device, it will not respond or break off responseto the command. All devices but the fastest will eventually detect thatanother device is active and will cease responding. As explained later,this process is accomplished is such a way that no data corruption ispossible. The single device that detects no collision will have reportedit serial number at the end of the communication cycle. The found deviceis then given a command such that it will not respond to the globalreport serial number command. The global command is reissued and becausethe first devices will no longer respond, another device will win andreport a valid serial number. This process continues until all deviceshave been found. Each device can not be uniquely addressed and willfunction independently.

[0023] 5. Self-clocking encoding method providing a excellent noiseimmunity in poorly connected, high noise environments.

[0024] 6. A command and response base protocol defining the power andcommunication phases such that the communication circuits need only tosource or sink a limited amount of current and thus the size of thedevices and the power dissipated can be reduced.

[0025] 7. A four state system that provides full power during stateswhere work is being done and lesser power matched to the communicationsneeds of the system during the communication phases. Demeyer teachesthat a two to one range between the communication current sourced andthe load current is recommended. By providing high power andcommunication modes, the supplied power between the communication stateand the power stated can easily be separated by a factor of ten. Thevoltage and current can be uniquely defined and optimized to match theintended use.

[0026] 8. A collisions detection method that can detect collisions bylooking at the state of the line prior to imposing a low state. If theline is already in a low state, another function is communicating. Thisprocess provides a more robust method with fewer parts at a lower costthan the currently taught methods.

SUMMARY OF THE INVENTION

[0027] A apparatus and methods comprising a computer or processor basedcontrol system, one or more base units, a number of remote sensing andor remote control elements, capable of controlling and monitoringcomplex systems over large distances in an electrically noisyenvironment. The processor base control system, if included, may or maynot be part of the base unit or may be a any other separatecomputational apparatus such as a personal computer or programmablecontroller mounted at a remote location.

[0028] A method of communicating control and data information togetherwith power supply voltage down a common pair of conductors where thephysical routing of the individual conductors is not critical. Themethod is also capable of communicating for distances of many thousandfeet. The invention comprises a method where a power source is locatedat a base unit and encoders and decoders are located both at the baseunit and at each remote sensing and/or control site for two-waycommunication.

[0029] This method separates operation into two time phases, one phasebeing a power delivery phase and the other phase is a communicationphase. During the power delivery phase, the power supply voltage issupplied down the pair of conductors to all of the remote sensors andcontrol circuits. In the communication phase, power delivery is reducedand the remote sensors and control circuits operate on energy stored intheir respective capacitive storage element. Communication between thevarious units is achieved during this phase.

[0030] A method whereby a working communication protocol is achieved byalternately energizing and de-energizing a pair of conductors. Theencoding protocol is based on the amount of time between transitions todetermine if the bit is a one or zero. This encoding protocol is aself-clocking code where all bit boundaries are marked by a transitionfrom high to low or low to high on the pair of conductors. The selfclocking capability of the code is important because timing errors incoding are not additive over multiple bits, but are constrained to onlythe current bit time. Clocking can now be implemented effectively with amicroprocessor without crystal control. The preamble and post-amble isalso self-clocking. In the first implementation, the time betweentransitions of a one bit is three times the length of a zero bit. Eighttransitions or bits are grouped into bytes and a number of bytes aregrouped into a data field. A message is composed of a preamble, a datafield, and a post-amble. Normal communication is based on a commandmessage, a processing phase or time, and a response message. Remoteunits are able to detect that a communication process is starting bymonitoring the conductor pair for a preamble. The command messageprovides a command and associated data to the remote unit. The remoteunit processes the command and data (the processing phase), and thenreturns the resultant data to the base unit during the response phase.All communication messages contain checksum bytes ensuring that the dataand command sent and received have not been corrupted.

[0031] A method whereby if multiple devices attempt to respond to asingle command message, they each detect possible message collisions andwill stop their communication message in order to avoid the corruptionof another units response message. The method is such that a singleresponse message is guaranteed to arrive at the base unit withoutcorruption. This method is very important because it allows for anautomatic discovery and configuration of the system without the need forcomplex retry and recovery algorithms as in many computer networks. Seethe earlier description.

[0032] An apparatus for sourcing power at controlled levels such thatduring the power-sourcing phase, substantial power is supplied to theremote devices and such that during the communication phase the powersystem supplies a fractional portion of normal power while thecommunication apparatus, including the encoder and decoder, function.The apparatus is also able to detect both open and shorted circuits andreact appropriately such that the system is controlled in a way as toprevent system damage during these situations. The apparatus is able tosupply power only when the system is actively functioning and disablethe supply of power to the remote units when the system is idle toconserve power consumption and reduce degradation of the conductor pairthrough unnecessary electrolysis of damaged wire.

[0033] An apparatus for alternately raising and lowering the voltage onthe lines such as to achieve the encoding method described above. Theapparatus will be capable of decoding the time and voltage levels toextract the encoded information.

[0034] An apparatus for generating a wave form from a 24 volt DC supplyin a way that it can properly operate an industry standard 24 Volt ACsprinkler valve. The coil inductance is used as an energy storagedevice. The apparatus utilized techniques similar to those used inswitching power supplies to raise efficiency. Increased efficiencyconserves energy, and increases system reliability.

[0035] An apparatus for interfacing various sensors, including moisture,temperature, pressure, flow, voltage, current, and relay closure, suchthat these sensors can receive commands, perform measurements and reportresults.

[0036] A method whereby commands and data are encoded into aCommand-Response Protocol that uniquely defines each command with theexpected action and response.

BRIEF DESCRIPTION OF THE DRAWINGS

[0037]FIG. 1 is a system block diagram of a computer, a base unit with atwo-wire power sourcing system, and a number of remote units inaccordance with the invention.

[0038]FIG. 1B is a system block diagram of an Irrigation System with acomputer, a number of base units showing both wire and wirelesscommunications at several stages in the system topology. A variety ofremote units is shown as representative of those needed in a system.

[0039]FIG. 1C is a system block diagram of a HVAC System with computer,a number base units with a two-wire power sourcing system, and a numberof remote units in accordance with the invention.

[0040]FIG. 1D is a system block diagram of a Data Collection System,with a computer, a set of base units with a number of remote units inaccordance with the invention.

[0041]FIG. 2 is a block diagram of a base unit including the powersourcing system and computer interface in accordance with the invention.

[0042]FIG. 3 is a block diagram of a remote unit in accordance with theinvention.

[0043]FIG. 4 is a detailed schematic diagram of power sourcing systemthat forms a part of the apparatus in accordance with a preferredembodiment of the invention.

[0044]FIG. 5 is a detailed schematic diagram of an encoder and decodercircuit that forms a part of the apparatus in accordance with apreferred embodiment of the invention.

[0045]FIG. 6 is a detailed diagram of a two-wire communication packetshowing the various phases that forms a part of the encoding anddecoding method in accordance with the preferred embodiment of theinvention.

[0046]FIG. 7 is a detailed diagram of a two-wire communication packetshowings the collision prediction and avoidance method that forms a partof the encoding and decoding method in accordance with the preferredembodiment of the invention

[0047]FIG. 8 is a message definition diagram for the communicationpackets between the computer and the base unit. There are two types ofpackets, control and pass-through.

[0048]FIG. 9 is a message definition for the communication packetsbetween the base unit and remote units.

[0049]FIG. 10 is a block diagram showing the basic method for drivingthe irrigation valves. Irrigation valves are a 24 VAC device and thesystem uses a 24 VDC modulation method to achieve an equivalentoperation in a more efficient manner.

[0050]FIG. 11 is a detailed schematic diagram for an irrigation valvecontroller.

[0051]FIG. 12 is a diagram of the system protocol architecture and thedefinition of each of the protocol layers used in the system.

DETAILED DESCRIPTION OF THE INVENTION

[0052] System Operation

[0053]FIG. 1 is a system block diagram showing the invented apparatus inconjunction with a computer 1, a Processor Based Control System, a BaseUnit including the Power Source, Encoder and Decoder 2, and an interfacecable 14 connected there between. The invented apparatus includes aComputer 1 and the interface cable 14 will be understood to beconventional and, importantly, invented apparatus requires nomodifications thereto. Interface cable 11 is in general accord with thereferenced Universal Serial Bus (USB) Specification, Revision 1.0 or 2.0or standard RS232 Serial Cable. Remote Devices 3-11 are connected bygeneral-purpose wire of sufficient gage to conduct the required amperagefor the specified distance. One wire 12 is at system ground potentialand the second wire 13 is energized to supply power and carries theencoded data transmissions. The diagram indicates both daisy chain andstar configurations for conductors 12 and 13 to indicate the flexibilityof the system. The diagram further shows a loop connection of the wireto show a wire redundancy configuration of the system. Existing wiring,for example the buried wire of a sprinkler control system, can beutilized for conductors 12 and 13. Remote devices 3-10 contain encodingand decoding circuitry and have the ability perform a remote functionunder the control of the computer 1 through the power source 2. Theremote devices can be designed to perform many varied functions fromcontrol of electromechanical devices to sensing of temperature,pressure, moisture, flow and many other functions.

[0054]FIG. 1B demonstrates a sprinkler irrigation system containingremote valve actuators to enable the system valves, moisture sensors todetermine the moisture content of the soil, water pressure and flowmeters, and rain and air temperature sensors to monitor the sprinklersystem performance.

[0055]FIG. 1C demonstrates a heating, ventilation and air conditioningmonitor or controller showing temperature sensors for intake and outletair, boiler temperature, room temperature, airflow, actuator control,and relay activation circuits to enable control of a site containing anumber of heating and cooling systems.

[0056]FIG. 1D demonstrates this technology applied to data collectionapplication where a number of remote moisture sensors are used tomonitor the level of ground water in a number of locations, and otherenvironmental sensors to collect other data.

[0057] These three specific application demonstrations are given to showthe technology in a number of basic types of applications where sensing,control or sensing and control are important. The first applications forthis technology are in the areas of irrigation sprinkler control andHVAC control: however, it is obvious that the technology is applicableto many control and sensing applications.

[0058] Base Unit

[0059]FIG. 2 shows a block diagram of the base unit. The base unitreceives data from and transmits data to the computer over an industrystandard computer interface port such as the Universal Serial Bus (USB)or RS 232, or it receives data from and transmits data to the ProcessorBased Control System over a proprietary bus. The remote unit commandsare encoded on the two-wire bus to be sent to a remote device foraction. Responses are received from the remote devices over the two-wirebus. The base unit also manages the basic two-wire bus by detectingshorts and opens in the bus. The base unit also has the ability todetect the basic quality of the transmission received and monitordegradation of the two-wire bus by accurately measuring the time betweeneach transition and computing a quality factor based on the variation ofthe transition timing with the expected timing. The base unit iscomposed of a micro controller that provides the computational processesnecessary. The power source provides power at two levels. The high powerlevel, activated by raising the high power line to a logical one,provides operational power for the devices. The devices is currentlimited such that a shorted wire will not harm the system. The microcontroller monitors the power provided to the two-wire bus such that ifit exceed a preset level for a fixed length of time, the microcontroller will shut down the power to the two-wire system and report tothe computer or control system that an over current situation hasoccurred. The micro controller, using the current sense and voltagesense lines provided, monitors system power usage and is able to measurethe voltage drop on the two-wire connection during communication with aremote unit. This voltage drop is transformed into a resistancemeasurement of the wired connection, which provides an objectivemeasurement of the quality of the two-wire bus, and can indicatedegradation over time. The limited power level activated by lowering thehigh power line and by raising the low power line provides sufficientpower for the communication process. The functions of the ProcessorBased Control System may be included in the base unit if a userinterface apparatus, real time clock and additional RAM are added.

[0060]FIG. 4 shows the power sourcing circuitry. Power is applied to thecircuit through jack J1. Diode D1 and Fuse F1 protect the circuitry fromdamage if a power supply with the incorrect polarity is connected. Thetransorb protects the circuitry from voltage spikes. When System DriveLow is raised, current flows through Q8 and is proportional to thevoltage across R26. Current flows through the base of Q3 that thenprovides base current to both Q2 and Q1. The voltage across Q1 is=(V_(SystemDriveLow)−0.6V)R7/R26. The current through Q1 increases untilthe voltage across the parallel combination of R1, R2, R6, R10 and R11equal the voltage across R7. By the correct choice of resistors, the lowdrive current for the system is established. When System Drive High israised, additional current is sourced to the base of Q3. As the currentincreases to the two-wire system, the voltage across parallelcombination of R1, R2, R6, R10 and R11 raises until it reachesapproximately 0.6 volts and Q14 turns on sourcing some of the drivecurrent and thus performing a current limiting function and determiningthe short circuit current supplied to the two-wire system. Q4, Q5 and Q6in combination with R12, R13, R22, and R23 form a current sense circuitpresenting the micro controller with a voltage that is representative ofthe instantaneous current supplied to the two-wire system. Resistors R24and R27 present the processor with the instantaneous voltage on thetwo-wire bus. The micro controller monitors the two-wire voltage andcurrent through these two lines. It the current is excessive, the microcontroller shuts down the two-wire system by lowering System Drive Highand System Drive Low.

[0061]FIG. 5 is a schematic diagram of the Encoder and Decodercircuitry. U2 is a voltage comparator that is biased by R29, R30 and R31such that the output is pulled to Vcc when the two-wire bus is high anddrops to a logical zero when the two-wire voltage is low. Raising thegate, Pin 1, to five volts, activates Q9 allowing Q9 to sink the currentprovided by the bower sourcing circuitry and producing a low voltagelevel on the two-wire bus.

[0062] Remote Unit

[0063]FIG. 3 is a block diagram of the basic remote device.Communication is achieved by an encoder, either the base unit or one ofthe remote encoders sinking the current sourced by the power source suchthat the voltage on the two-wire bus drops to a logical zero. When theencoder no longer sinks the supplied current, the voltage rises and alogical one is impressed on the two-wire bus. The encoder is a lowimpedance semiconductor such as an N-channel FET or NPN transistor thatwhen energized by the micro controller, sinks the current sourced by thepower source. The decoder is a comparator that translates the highvoltage on the two-wire bus to the voltage required by the microcontroller. When the voltage is above a set threshold, a logical one ispresented to the microprocessor. If it is below that threshold, alogical zero is presented. The decoder has sufficient positive feedbackon the comparator to prevent noise in the system from presenting falsetransitions to the micro controller. The system is designed to take fulladvantage of the excellent computational capabilities of current, microcontrollers. This invention is targeted at cost sensitive applicationsand therefore, for minimal costs, all complex timing functions andcomputational functions are preformed by the micro controller. Theremote unit also has the ability to detect the basic quality of thetransmission received and monitor degradation of the two-wire bus byaccurately measuring the time between each transition and computing aquality factor based on the variation of the transition timing with theexpected timing.

[0064] Valve Actuator and Control Apparatus

[0065]FIG. 10 demonstrates a valve power control apparatus that allowsindustry standard 24 volt AC. irrigation valves to be used on this 24volt DC system. This block comprises the Remote Sense or ControlCircuitry shown in FIG. 3. The valve power control apparatus willcontain all blocks show in FIG. 3 in addition to those shown in FIG. 10.The micro controller show in FIG. 3 is repeated in FIG. 10 in order toincrease clarity. The line Power On/Off is raised enabling the voltageswitch to gate the voltage across the 24VAC Valve. The valve is asolenoid, which electrically is an inductor with a movable core.Therefore, when voltage is applied to the winding of the solenoid, thecurrent increases in the winding. The rate of increase is proportionalto the applied voltage and the time constant of L/R. where L is theinductance of the solenoid and R is the resistance of the solenoid. Whenthe Power On/Off line is lowered, current is no longer supplied by the24VDC line, but is drawn through diode D1. The current in the inductordegrades with the time constant of L/R where again L is the inductanceof the solenoid and R is the resistance of the solenoid. The currentwill continue to degrade until it reaches zero amps or another pulse isapplied to the coil. 24 VDC Current 2 is the current drawn from the 24VDC source. The average of Valve Current 1 therefore is significantlygreater that the current drawn from the 24 VDC supply. Current in thesolenoid is multiplied in much the same way as a switching power supplyuses an inductor and switching transistor and diode to multiply currentand reach very high efficiency. The current design is constructed toproduce a current multiplier of three, or one third of the current comesfrom the 24 VDC supply and two thirds comes through the diode. Thehigher efficiency allows us to support more valves on the same wire gagewhen compared to traditional AC systems. The gain in efficiency alsoallows us to be generally more energy efficient.

[0066]FIG. 12 shows detailed schematics of the Valve Actuator andControl Apparatus. The PIC12C673 and the reset circuit composed ofcomparator U2B, R19, R15, R17, C3, R1 make up the micro controllerblock. R11, R12, R23, R10, R9, D4 and U2A make up the decoder block. R3and Q1 make up the encoder block. Energy stored on C1 power thecircuitry during the communication phases. U1 is a five-volt regulatorproviding power to the micro controller. The voltage on the raw supplyV_(—)24 is divided down by the resistive divider comprised of R21 andR22. The output is supplied to an analog to digital converter input onthe micro controller. This is used by the system to monitor the systemperformance. The system is able to determine if there is excessiveresistance in the two-wire system, whether the system has poorconnections or if it is overloaded by monitoring the voltage at thispoint. The current sense circuitry monitors the flow of current throughthe load. The current sense circuitry is composed of Q4, Q5, Q8, R4,R12, R16 and R18. The voltage drop across R6, R7 and R8 is measured andthe current through R16 is set based on that voltage drop. The microcontroller reads this voltage and is able to monitor the current throughthe load. The system uses reading to detect a short circuit or otheroverloaded conditions. Most valve failures caused by open circuits orshort circuits are preceded by changes in the coil resistance. Whenthese changes are sensed, a warning can be given that failure isemanate. The valve is actuated by raising the base of Q8 to 5 voltscausing current to flow through the collector of Q8. a portion of thiscurrent then flows through the base Q6 and the base of Q3 turning on Q3and applying voltage to the output. If the voltage across R6, R7, and R8exceeds 0.6 volts, Q2 begins to conduct limiting the current through Q3.D6 provides the conduction path for the solenoid when the base of Q8 islowered turning off Q3. R14 and D5 provide a visible indication that theoutput is powered.

[0067] Communications

[0068]FIG. 6A is a diagram showing a full communication cycle. Allcommunication sequences begin with the computer or control unit sendinga command to a base unit over a standard connection. The command witheither be executed by the base unit and a response returned to thecomputer, or it will be forwarded on to the two-wire bus to a targetremote device. In the latter case, the response message from the remoteunit will be received by the base unit and then returned to thecomputer. If the remote unit does not respond within a specified time,an error response will be sent to the computer indicating the errorcondition.

[0069] Two-Wire Communication Phases

[0070]FIG. 6B is a diagram showing a detailed two-wire communicationcycle. In the High Power Phase, the system is delivering full power tothe remote devices and the remote devices are performing theirindividual functions. When the computer sends a command to the base unitthat is to be forwarded on to a remote device, the base unit reduces thecurrent available to power the two-wire system. The base, unit encoderthen activates, pulling the voltage to ground, by sinking the sourcedcurrent to bring the two-wire voltage to a logical zero volt level. Thelow level indicates to all remote units that a message-preamble hasbegun, and that a communication will follow. After a prescribed time,the encoder then allows the voltage to rise to a logical high level fora determined amount of time to complete the preamble of the message. Thecommunication cycle continues as the base unit encodes the messagereceived from the computer by serially placing each bit on the two-wiresystem. The first bit is pulled low by the encoder sinking current tobring the voltage on the two-wire system to a logical zero. If thecommunicated bit is a “one” then the bit is held low for three units oftime. If the communicated bit is a “zero” the bit is held low for onlyone unit of time. At the conclusion of the required time specified bythe bit being a “one” or a “zero” the encoder releases the line and thecurrent source in the power source drives the two-wire potential to fullvoltage. The voltage remains at the high level for one unit of time ifthe next bit is a “zero” bit or three units of time if the bit is a“one” bit. This process continues until each bit of the data field, inthe communication cycle, has been impressed on the two-wire bus. A final“low” on the two-wire for a set amount of time signifies the post-ambleor end of message. In FIG. 6, the One Byte Transfer Detail shows asequence of eight bits.

[0071] Note that the “zero” bits are one unit of time long, and the“one” bits are three units of time long. The basic concept of utilizingone time for a logical one and another for a logical zero was first usedbetween 1970 and 1980 to encode computer data on computer magnetictapes. This code was not very efficient because it contains at lease onetransition per bit and contains a DC component that is difficult todecode accurately in a magnetic read channel. While the basic concept ofusing long and short bit times to encode data exists as prior art, wefeel that we have made significant contributions in adapting this codeto run in a cost sensitive but electrically hostile environment. We havemodified and extended the code to use in this application and have addedthe necessary definition, pre and post ambles necessary to form a uniqueand cost effective solution for this environment. The two-wire signalmoves between zero volts and the power supplies voltage and therefore iswell adapted to code containing a DC component. The entire message iscomposed of a number of bytes. Each byte is composed of eight bits. Thefirst byte of the message is the address of the remote to which thecommand is addressed. The next six bytes composed the body of themessage. The last two bytes are checksum composed of the sum of theprevious seven bytes. The remote device computes the checksum on thefirst seven bytes and compares it to the received check sum. If they areidentical, the message is valid. If they are not, the message has beencorrupted during transmission and is discarded.

[0072] At the conclusion of the message, the remote units can use thistime to perform any commands sent during the command sequence. At theend of the minimum specified processing time, the remote unit addressedby the command message would activate and send a preamble. The localencoder sinks the current supplied by the base unit power sourcebringing the voltage on the two-wire bus to a logical zero. The lowlevel indicates that a communication from the remote will follow. Aftera prescribed period, the encoder then allows the voltage to rise to alogical high level allowing the base unit to prepare the communicationcycle to follow. The remote devices use the same protocol forcommunication and hold the bus low for one unit of time if the bit is a“zero” and three units of time if the bit is a logical “one”. The entiremessage is composed of nine bytes. Each byte is composed of eight bits.The first seven bytes composed the body of the response message. Thelast two bytes are a checksum composed of the sum of the previous sixbytes. The base unit computes the checksum on the first seven bytes andcompares it to the received checksum. If they are identical, the messageis valid. If they are not, the message has been corrupted duringtransmission and is discarded.

[0073] Configuration and Collision Avoidance

[0074] Every remote unit has a unique serial number. When the system isconfigured, each remote unit is assigned a unique address on thetwo-wire system such that it can be addressed easily and independently.During the configuration process, it is advantageous for the system tobe able to perform an auto discovery function and detect all remoteunits connected to the two-wire system. The invented method of detectingpotential collision and avoiding data corruption enables this autodetection and identification function. The two-wire power is suppliedthrough a current source that pulls the two-wire voltage to the requiredvoltage level. An encoder on the base unit or one of the remotes sinkingthe current and pulling the two-wire voltage low produces a logicaltwo-wire low level. The encoders are open collector or open draindevices and as such can be activated concurrently without damaging thedevice. However, if two devices both answer and attempt to send a fullresponse, the response from both devices would mix and produce acorrupted return. The method of collision avoidance requires that priorto each transition from a high two-wire voltage to a low two-wirevoltage, the sending unit checks the level of the two-wire voltagebefore activating its encoder. If the voltage is low already, the remotedoes not enable the encoder and terminates sending the response message.This allows the competing response messages to be sent withoutcorruption. The system discovers the remote units on the system bytransmitting a return serial number command to all remote units. Eachremote unit will attempt to transmit its serial number. Each remote unitwill wait a pseudo-random delay before attempting to send a response. Aseach remote unit begins to send a preamble, it checks to see if the lineis already low. If the two-wire is already low, the remote unitdiscontinues its response and will wait for the next command from thebase unit. Because the remote units start their response messages withsome time variance, most of the remote units will drop off during thegeneration of the preamble as is shown in FIG. 7. If by chance multipleremote units happen to send a synchronized preamble, remote units willdropout as they detect potential collisions with their data stream. TheData Phase of FIG. 7 shows additional points of possible collision thatare detected. As a remote unit detects a potential collision, it willback off and wait for the next command, allowing the other remote unitto complete without error. Because each remote unit has a unique serialnumber, each remote unit will be responding with a different datastream, which will guarantee that only a single remote unit willcomplete successfully. The remote unit that communicates its serialnumber successfully is then given a command to “sleep” and the processis repeated until all remote units are found and put into a sleep state.Remote units no longer respond when in the sleep state. All remote unitswill have been found when there is no response to the return serialnumber command.

[0075] Command-Response Protocol

[0076]FIG. 8 is a representation of the command/response level protocolsthat are used to communicate between the controlling computer and thebase unit. The byte definitions for the two types of packets arespecified. The system operates on a command and response operationmodel. The computer sends a command to a base unit (the system providesan addressing method for communicating with multiple base units). Thiscommand is either processed by the base unit or the encapsulated messageis forwarded to the addressed remote unit over the two-wire system. Whenthe addressed base unit has processed the command, it composes aresponse message and sends it back to the computer (there. are commandsthat do not send a response). If the command is a pass-through, theencapsulated message is sent over the two-wire network to the addressedremote unit. The base unit will then wait for a response from the remoteunit. This response will be encapsulated and then sent forward to thecomputer. If there is no response from a remote unit within theallowable time, then an error message is sent to the computer indicatingthat no message was received. All messages are protected by checksumcodes to verify message integrity. The base unit does not interpretmessages that are passed-through to remote units. FIG. 9 shows the bytedefinitions for a remote unit message.

[0077] Communication Protocol Layers

[0078]FIG. 11 describes the communication protocol architecture. Thespecified layered protocol is a simplification of the seven layersdefined Open System Interconnection (OSI) Network Protocol Layersstandard. This system is based on a layered architecture and providessignificant benefits over a non-layered approach. Within thearchitecture, new layers can be employed in the future with a minimum ofeffort and without modification to the other layers in the system. Thismeans that changing the interface bus between the computer and thebase-unit(s) from RS-232 to USB or to a 10-100 Mbit LAN will not requirea change in the messages used for system operation.

[0079] Layer 4 messages define the operation of the system in a specificset of functions that the Base Units and the Remote Units can execute.Then the computer needs to communicate with a base unit or a remoteunit, it only needs to send the corresponding message to the target unitand wait for a response. The details of the other layers of thearchitecture are hidden from this message layer. Layer 3 providesaddressing, handles timeouts, checksum calculations and verifies dataintegrity. It does not know what kind of message is being sent (a layer4 issue), nor does it understand the nature of the layer 1 and 2implementations. Layers 1 and 2 implement bit encoding, bit timing, andthe electrical characteristics of the connection. Keeping this isolatedfrom the other layers allows new connection technologies to be insertedinto the implementation without needing to change the other layers ofthe system.

[0080] Device Addressing

[0081] The system provides a method to use three classes of addresses.There is a global address method for all base units and remote units.All units will execute the requested command sent to the global address.Direct addresses target only the device with the corresponding address.Commands or requests with an illegal address are always discarded. Thefollowing table summarizes the address assignments: Address Type BaseUnits Remote Unit Comment Global 0x00 0x00 All devices execute thesecommands Direct 0x01 to 0x07 0x01 to 0xFE Only addressed devicesexecutes command Illegal 0xFF 0xFF No device responds to this address.It is used as a temporary address for remotes.

[0082] Base Unit Command-Response Protocol

[0083] Status Codes—Base Units

[0084] Most base unit commands have a response comprised of data and astatus code. The following table summarizes the status codes that areused on response packets: HEX DEC Code Description 0x01 001 Success/OKSuccess 0x02 002 Over Current Two-wire current limit exceeded: less than‘50 ’ count for ˜1.5 s. 0x03 003 No Response No response from remoteunit within 24 ms. 0x04 004 I2C Error Communication error with I2Cdevice (Clock, EEPROM, Temperature, other. . .) 0x05 005 Illegal Unknowncommand. Command 0x06 006 Command Unable to do command (2-wire IDw/power Rejected down) 0x07 007 Checksum Returned packed on a 2-wirecommand had a Error checksum error (partial data is returned)

[0085] Commands—Base Units

[0086] The following set of tables provides a definition of the firstset of base unit commands. ResetBaseUnit This command will reset theBase unit to a power up state. This is done through the watchdog timer.The 2-wire is shut down. # Definition Sent to Base Unit Returned to PC 0Base Addr Base Unit Address or Global No reply 1 Base Command 0xC1 (193)2 Data0 X 3 Data1 X 4 Data2 X 5 Data3 X 6 Data4 X 7 Data5 X 8 Data6 X 9Data7 X 10 Data8 X 11 PC Status X 12 PC Checksum1 PC Checksum Lo 13 PCChecksum2 PC Checksum Hi EnableUnit Enables Base Unit to accept commandson serial port. Base Unit powers up disabled. # Definition Sent to BaseUnit Returned to PC 0 Base Addr Base Unit Address Base Unit Address 1Base Command 0xC2 (194) 0xC2 (194) 2 Data0 X 0 3 Data1 X 0 4 Data2 XType Minor 5 Data3 X Type Major 6 Data4 X Version Minor 7 Data5 XVersion Major 8 Data6 X 0 9 Data7 X 0 10 Data8 X 0 11 PC Status X PCStatus = 1 | 2 12 PC Checksum1 PC Checksum Lo PC Checksum Lo 13 PCChecksum2 PC Checksum Hi PC Checksum Hi TestBaseChannel Returns the bitlengths (counts) for Bits 0-5 of byte Data4 after it is received fromthe target remote unit. # Definition Sent to Base Unit Returned to PC 0Base Addr Base Unit Address Base Unit Address 1 Base Command 0xC3 (195)0xC3 (195) 2 Data0 Remote Addr Remote Addr 3 Data1 X (uses EchoPacker)Bit0 Count 4 Data2 X Bit1 Count 5 Data3 Bit Pattern Bit2 Count 6 Data4 XBit3 Count 7 Data5 X Bit4 Count 8 Data6 X Bit5 Count 9 Data7 X 2-WireChkSumLo 10 Data8 X 2-Wire ChkSumHi 11 PC Status X PC Status = 1 | 2 | 512 PC Checksum1 PC Checksum Lo PC Checksum Lo 13 PC Checksum2 PCChecksum Hi PC Checksum Hi SetBaseChannelParams Sets the channelparameters . . . pre-compensation. NOT saved in EEPROM. # DefinitionSent to Base Unit Returned to PC 0 Base Addr Base Unit Address Base UnitAddress 1 Base Command 0xC4 (196) 0xC4 (196) 2 Data0 X 0 3 Data1 X 0 4Data2 Precomp Count (# of 1.6 us) Precomp Count (# of 1.6 us) 5 Data3 X0 6 Data4 X 0 7 Data5 X 0 8 Data6 X 0 9 Data7 X 0 10 Data8 X 0 11 PCStatus X PC Status = 1 | 2 | 4 | 5 12 PC Checksum1 PC Checksum Lo PCChecksum Lo 13 PC Checksum2 PC Checksum Hi PC Checksum Hi BaseUnitStatusThe will return the current base unit status and error counts. #Definition Sent to Base Unit Returned to PC 0 Base Addr Base UnitAddress Base Unit Address 1 Base Command 0xC5 (197) 0xC5 (197) 2 Data0 X0 3 Data1 X 2-Wire Powered Up 4 Data2 X 2-Wire Checksum Error Count 5Data3 X 2-Wire Frame Error Count 6 Data4 X 2-Wire Collisions Count 7Data5 X Serial IO Checksum Error Count 8 Data6 X Serial IO Frame ErrorCount 9 Data7 X Serial Illegal Command Count 10 Data8 X 0 11 PC Status XPC Status = 1 | 2 12 PC Checksum1 PC Checksum Lo PC Checksum Lo 13 PCChecksum2 PC Checksum Hi PC Checksum Hi BaseUnitStatusClear The willreturn the current base unit status, error counts, and then clearscounts and possible over current condition. # Definition Sent to BaseUnit Returned to PC 0 Base Addr Base Unit Address Base Unit Address 1Base Command 0xC6 (198) 0xC6 (198) 2 Data0 X 0 3 Data1 X 2-Wire PoweredUp 4 Data2 X 2-Wire Checksum Error Count 5 Data3 X 2-Wire Frame ErrorCount 6 Data4 X 2-Wire Collisions Count 7 Data5 X Serial IO ChecksumError Count 8 Data6 X Serial IO Frame Error Count 9 Data7 X SerialIllegal Command Count 10 Data8 X 0 11 PC Status X PC Status = 1 | 2 12PC Checksum1 PC Checksum Lo PC Checksum Lo 13 PC Checksum2 PC ChecksumHi PC Checksum Hi ReadBaseUnitPower This will return power consumptionreadings for base unit. Takes readings over 50 ms, returns highestcurrent, and corresponding voltage. # Definition Sent to Base UnitReturned to PC 0 Base Addr Base Unit Address Base Unit Address 1 BaseCommand 0xC7 (199) 0xC7 (199) 2 Data0 X 0 3 Data1 X 0 4 Data2 X CurrentLo [max between commands] 5 Data3 X Current Hi [max between commands] 6Data4 X Volts Lo [max between commands] 7 Data5 X Volts Hi [max betweencommands] 8 Data6 X 0 9 Data7 X 0 10 Data8 X 0 11 PC Status X PC Status= 1 | 2 12 PC Checksum1 PC Checksum Lo PC Checksum Lo 13 PC Checksum2 PCChecksum Hi PC Checksum Hi PowerUp2Wire This command will power up thetwo-wire system. The Base unit powers up with the two-wire systempowered down. # Definition Sent to Base Unit Returned to PC 0 Base AddrBase Unit Address or Global Base Unit Address 1 Base Command 0xC8 (200)0xC8 (200) 2 Data0 X 0 3 Data1 X 0 4 Data2 X Current Lo [2 ms reading] 5Data3 X Current Hi [2 ms reading] 6 Data4 X Volts Lo [2 ms reading] 7Data5 X Volts Hi [2 ms reading] 8 Data6 X 0 9 Data7 X 0 10 Data8 X 0 11PC Status X PC Status = 1 | 2 | 5 12 PC Checksum1 PC Checksum Lo PCChecksum Lo 13 PC Checksum2 PC Checksum Hi PC Checksum Hi PowerDown2WireThis command will power down the two-wire system # Definition Sent toBase Unit Returned to PC 0 Base Addr Base Unit Address or Global BaseUnit Address 1 Base Command 0xC9 (201) 0xC9 (201) 2 Data0 X 0 3 Data1 X0 4 Data2 X Current Lo [2 ms reading] 5 Data3 X Current Hi [2 msreading] 6 Data4 X Volts Lo [2 ms reading] 7 Data5 X Volts Hi [2 msreading] 8 Data6 X 0 9 Data7 X 0 10 Data8 X 0 11 PC Status X PC Status =1 | 2 | 5 12 PC Checksum1 PC Checksum Lo PC Checksum Lo 13 PC Checksum2PC Checksum Hi PC Checksum Hi ReadClock This reads the date/time fromthe real-time clock. Only the Button box has a clock chip. # DefinitionSent to Base Unit Returned to PC 0 Base Addr Base Unit Address Base UnitAddress 1 Base Command 0xCA (202) 0xCA (202) 2 Data0 X Seconds (0-59) 3Data1 X Minutes (0-59) 4 Data2 X Hours (0-23) 5 Data3 X Day of Week(1-7) 6 Data4 X Day (1-31) 7 Data5 X Month (1-12) 8 Data6 X Year (0-99)9 Data7 X 0 10 Data8 X 0 11 PC Status X PC Status 1 | 2 | 4 | 5 12 PCChecksum1 PC Checksum Lo PC Checksum Lo 13 PC Checksum2 PC Checksum HiPC Checksum Hi SetClock This sets the date/time from the real-timeclock. Only the Button box has a clock chip. # Definition Sent to BaseUnit Returned to PC 0 Base Addr Base Unit Address Base Unit Address 1Base Command 0xCB (203) 0xCB (204) 2 Data0 Seconds (0-59) Seconds (0-59)3 Data1 Minutes (0-59) Minutes (0-59) 4 Data2 Hours (0-23) Hours (0-23)5 Data3 X Day of Week (1-7) 6 Data4 Day (1-31) Day (1-31) 7 Data5 Month(1-12) Month (1-12) 8 Data6 Year (0-99) Year (0-99) 9 Data7 X 0 10 Data8X 0 11 PC Status X PC Status 1 | 2 | 4 | 5 12 PC Checksum1 PC ChecksumLo PC Checksum Lo 13 PC Checksum2 PC Checksum Hi PC Checksum HiReadBaseVersion This returns the base unit type and version information.All initial units hard coded to 00B0001. # Definition Sent to Base UnitReturned to PC 0 Base Addr Base Unit Address Base Unit Address 1 BaseCommand 0xCC (204) 0xCC (204) 2 Data0 X 0 3 Data1 X 0 4 Data2 X MinorVersion 5 Data3 X Major Version 6 Data4 X Minor Type 7 Data5 X MajorType 8 Data6 X 0 9 Data7 X 0 10 Data8 X 0 11 PC Status X PC Status = 1≡1 2 12 PC Checksum1 PC Checksum Lo PC Checksum Lo 13 PC Checksum2 PCChecksum Hi PC Checksum Hi ReadBaseSerialNum This returns the base unitserial number. # Definition Sent to Base Unit Returned to PC 0 Base AddrBase Unit Address Base Unit Address 1 Base Command 0xCD (205) 0xCD (205)2 Data0 X 0 3 Data1 X 0 4 Data2 X Serial Number 0 5 Data3 X SerialNumber 1 6 Data4 X Serial Number 2 7 Data5 X Serial Number 3 8 Data6 X 09 Data7 X 0 10 Data8 X 0 11 PC Status X PC Status = 1 | 2 | 4 | 5 12 PCChecksum1 PC Checksum Lo PC Checksum Lo 13 PC Checksum2 PC Checksum HiPC Checksum Hi TestTwoWireDrop This returns the 2-wire voltage measured1 ms into the 2 ms “low” preamble being driven by a remote device. #Definition Sent to Base Unit Returned to PC 0 Base Addr Base UnitAddress Base Unit Address 1 Base Command 0xCE (206) 0xCE (206) 2 Data0Remote Addr 0 3 Data1 X (uses Echo command) 0 4 Data2 X Current Lo 5Data3 X Current Hi 6 Data4 X Volts Lo 7 Data5 X Volts Hi 8 Data6 X 0 9Data7 X 0 10 Data8 X 0 11 PC Status X PC Status = 1 | 2 | 3 | 5 12 PCChecksum1 PC Checksum Lo PC Checksum Lo 13 PC Checksum2 PC Checksum HiPC Checksum Hi ForwardCommand The command will forward the Data0 toData8 encapsulated packet onto the 2-wire network. The response messagewill be returned to the PC w/o examination. # Definition Sent to BaseUnit Returned to PC 0 Base Addr Base Unit Address Base Unit Address 1Base Command 0xCF (207) 0xCF (207) 2 Data0 Remote Addr Remote ResponseData0 3 Data1 Remote Command Remote Response Data1 4 Data2 Remote Arg0Remote Response Data2 5 Data3 Remote Arg1 Remote Response Data3 6 Data4Remote Arg2 Remote Response Data4 7 Data5 Remote Arg3 Remote ResponseData5 8 Data6 Remote Status Remote Response Data6 9 Data7 RemoteChecksum1 Remote Checksum1 10 Data8 Remote Checksum2 Remote Checksum2 11PC Status Not used PC Status = 1 | 2 | 3 | 5 12 PC Checksum1 PC ChecksumLo PC Checksum Lo 13 PC Checksum2 PC Checksum Hi PC Checksum Hi

[0087] Remote Unit Command-Response Protocol

[0088] Status Codes—Remote Units

[0089] Most remote unit commands have a response comprised of data and astatus code. The following table summarizes the status codes that areused on response packets: HEX DEC Code Description 0x01 001 Success/OKSuccess 0x40 064 Over Current Valve current limit exceeded: less than‘50’ count for ˜100 ms. 0x41 065 Short Circuit Valve current limitexceeded: less than ‘50’ count in 2 ms. 0x42 066 Open circuit Nomeasurable valve current: greater than ‘220’ in 2 ms. 0x43 067 I2C ErrorCommunication error with I2C device (EEPROM, .) 0x44 068 Illegal Unknowncommand. Command 0x45 069 Command Unable to do command (attempted towrite Rejected to EEPROM without an unlock first).

[0090] Commands—Remote Units

[0091] The following tables define the first set of commands that areused with several of the remote units that implement the irrigationcontrol system. ResetRemoteDevice Returns the remote device to a powerup state. Only EEPROM information is preserved. Implemented withwatchdog timer. # Definition Sent to Remote Unit Returned to Base Unit 0RemoteAddr Global or Remote Address No reply 1 Command 0x01 2 Arg0 X 3Arg1 X 4 Arg2 X 5 Arg3 X 6 Status X 7 Checksum1 Checksum Lo 8 Checksum2Checksum Hi TestRemoteChannel Will return the times (counts) for bits0-5 of byte3 that is received by the remote unit. # Definition Sent toRemote Unit Returned to Base Unit 0 RemoteAddr Remote Address 0xFF 1Command 0x02 Bit0 count 2 Arg0 X Bit1 count 3 Arg1 Test Code Bit2 count4 Arg2 X Bit3 count 5 Arg3 X Bit4 count 6 Status X Bit5 count 7Checksum1 Checksum Lo Checksum Lo 8 Checksum2 Checksum Hi Checksum HiReadRemoteVersion This returns the version and type information for theremote device. # Definition Sent to Remote Unit Returned to Base Unit 0RemoteAddr Remote Address 0xFF 1 Command 0x03 0x03 2 Arg0 X MinorVersion 3 Arg1 X Major Version 4 Arg2 X Minor Type 5 Arg3 X Major Type 6Status X Status = 1 | 64 7 Checksum1 Checksum Lo Checksum Lo 8 Checksum2Checksum Hi Checksum Hi ReadSerialNumber Reads the serial number fromthe remote device. If global, devices back off when they detect apossible collision, allowing a single unit to complete successfully. #Definition Sent to Remote Unit Returned to Base Unit 0 RemoteAddr RemoteAddress or Global 0xFF 1 Command 0x04 0x04 2 Arg0 X Serial Number 0 3Arg1 X Serial Number 1 4 Arg2 X Serial Number 2 5 Arg3 X Serial Number 36 Status X Status = 1 | 64 | 67 7 Checksum1 Checksum Lo Checksum Lo 8Checksum2 Checksum Hi Checksum Hi GetRemoteStatus Returns status anderror counts from remote device. # Definition Sent to Remote UnitReturned to Base Unit 0 RemoteAddr Remote Address 0XFF 1 Command 0x050x05 2 Arg0 X 2-Wire Checksum Error Count 3 Arg1 X 2-Wire Frame ErrorCount 4 Arg2 X 2-Wire Illegal Command Count 5 Arg3 X 2-Wire CollisionCount 6 Status X Status = 1 | 64 7 Checksum1 Checksum Lo Checksum Lo 8Checksum2 Checksum Hi Checksum Hi GetStatusAndClear Returns status anderror counts from remote device, and then clears them. # Definition Sentto Remote Unit Returned to Base Unit 0 RemoteAddr Remote Address 0xFF 1Command 0x06 0x06 2 Arg0 X 2-Wire Checksum Error Count 3 Arg1 X 2-WireFrame Error Count 4 Arg2 X 2-Wire Illegal Command Count 5 Arg3 X 2-WireCollision Count 6 Status X Status = 1 | 64 7 Checksum1 Checksum LoChecksum Lo 8 Checksum2 Checksum Hi Checksum Hi ReadRemotePower Readsthe current and voltage information from the unit. # Definition Sent toRemote Unit Returned to Base Unit 0 RemoteAddr Remote Address 0xFF 1Command 0x07 0x07 2 Arg0 X Current Lo 3 Arg1 X Current Hi 4 Arg2 X VoltsLo 5 Arg3 X Volts Hi 6 Status X Status = 1 | 64 7 Checksum1 Checksum LoChecksum Lo 8 Checksum2 Checksum Hi Checksum Hi TurnValveOn Turns on avalve at the addressed remote unit. # Definition Sent to Remote UnitReturned to Base Unit 0 RemoteAddr Remote Address 0XFF 1 Command 0x080x08 2 Arg0 X Current Lo (2 ms wait) 3 Arg1 X Current Hi (2 ms wait) 4Arg2 X Volts Lo (2 ms wait) 5 Arg3 X Volts Hi (2 ms wait) 6 Status XStatus = 1 | 64 | 65 | 66 7 Checksum1 Checksum Lo Checksum Lo 8Checksum2 Checksum Hi Checksum Hi TurnValveListOn Turns on a valve atthe addressed remote units. # Definition Sent to Remote Unit Returned toBase Unit 0 RemoteAddr Global Address (0x00) No Reply 1 Command 0x09 2Arg0 Remote Addr1 3 Arg1 Remote Addr2 4 Arg2 Remote Addr3 5 Arg3 RemoteAddr4 6 Status Remote Addr5 7 Checksum1 Checksum Lo 8 Checksum2 ChecksumHi TurnValveOff Turns off a valve at the addressed remote unit. #Definition Sent to Remote Unit Returned to Base Unit 0 RemoteAddr RemoteAddress 0xFF 1 Command 0x0A (10) 0x0A 2 Arg0 X X 3 Arg1 X X 4 Arg2 X X 5Arg3 X X 6 Status X Status = 1 | 64 7 Checksum1 Checksum Lo Checksum Lo8 Checksum2 Checksum Hi Checksum Hi TurnAllValvesOff Turns off a valveat the addressed remote unit. # Definition Sent to Remote Unit Returnedto Base Unit 0 RemoteAddr Global Address (0x00) No Reply 1 Command 0x0B(11) 2 Arg0 X 3 Arg1 X 4 Arg2 X 5 Arg3 X 6 Status X 7 Checksum1 ChecksumLo 8 Checksum2 Checksum Hi ReadSensorSet1 Reads the first set of Sensorvalues from the unit. # Definition Sent to Remote Unit Returned to BaseUnit 0 RemoteAddr Remote Address 0xFF 1 Command 0x0C (12) 0x0C 2 Arg0 XTemperature Lo  Pressure Lo 3 Arg1 X Temperature Hi  Pressure Hi 4 Arg2X Moisture Lo  Flow Lo 5 Arg3 X Moisture Hi  Flow Hi 6 Status X Status =1 | 64 | 67 7 Checksum1 Checksum Lo Checksum Lo 8 Checksum2 Checksum HiChecksum Hi EchoPacket This just returns the identical packet. #Definition Sent to Remote Unit Returned to Base Unit 0 RemoteAddr RemoteAddress 0xFF 1 Command 0x0D (13) 0x0D (13) 2 Arg0 X X 3 Arg1 X X 4 Arg2X X 5 Arg3 X X 6 Status X X 7 Checksum1 Checksum Lo Checksum Lo 8Checksum2 Checksum Hi Checksum Hi UnlockRemote Unlocks the remote unitfor programming address or serial number. The Remote addressed devicewill be activated. There is a 2 second timeout on this unlock. Responseto base unit only on global address (factory). # Definition Sent toRemote Unit Returned to Base Unit 0 RemoteAddr Remote Addr or Global[port 1] 0xFF 1 Command 0x11 (17) 0x11 (17) 2 Arg0 X Version Minor 3Arg1 X Version major 4 Arg2 X Type Minor 5 Arg3 X Type Major 6 Status XStatus = 1 | 64 | 68 7 Checksum1 Checksum Lo Checksum Lo 8 Checksum2Checksum Hi Checksum Hi UnlockSerialNumber Unlocks the remote unit forprogramming address or serial number. The Remote address is “Global” andthe unit matching the Serial number is activated. There is a 2 secondtimeout on this unlock. # Definition Sent to Remote Unit Returned toBase Unit 0 RemoteAddr Global (0x00) 0xFF 1 Command 0x12 (18) 0x12 (18)2 Arg0 Serial 0 (global = valve port) Version Minor 3 Arg1 Serial 1(global = valve port) Version major 4 Arg2 Serial 2 (global = valveport) Type Minor 5 Arg3 Serial 3 (global = valve port) Type Major 6Status X Status = 1 | 64 | 68 7 Checksum1 Checksum Lo Checksum Lo 8Checksum2 Checksum Hi Checksum Hi WriteAddress Writes the address to theremote unit that is unlocked by the UnlockRemote command. The unit thenreturns to a locked state. # Definition Sent to Remote Unit Returned toBase Unit 0 RemoteAddr Global (0x00) 0xFF 1 Command 0x13 (19) 0x13 (19)2 Arg0 Remote Address Version Minor 3 Arg1 X Version major 4 Arg2 X TypeMinor 5 Arg3 X Type Major 6 Status X Status = 1 | 64 | 67 | 68 7Checksum1 Checksum Lo Checksum Lo 8 Checksum2 Checksum Hi Checksum HiWriteTempAddress Writes the address to the remote unit that is unlockedby the UnlockRemote command. The unit then returns to a locked state. #Definition Sent to Remote Unit Returned to Base Unit 0 RemoteAddr Global(0x00) No Response 1 Command 0x14 (20) 2 Arg0 X 3 Arg1 X 4 Arg2 X 5 Arg3X 6 Status X 7 Checksum1 Checksum Lo 8 Checksum2 Checksum HiSetChannelParams Sets 2-wire channel communication parameters for theremote unit. Values are kept in the EEPROM. # Definition Sent to RemoteUnit Returned to Base Unit 0 RemoteAddr Remote Address 0XFF 1 Command0x15 (21) 0x15 (21) 2 Arg0 Precomp Count (# of 1.6 us) Precomp Count (#of 1.6 us) 3 Arg1 Valve On Count Valve On Count 4 Arg2 Valve Off CountValve Off Count 5 Arg3 Valve Startup Count Valve Startup Count 6 StatusX Status = 1 | 64 | 67 | 68 7 Checksum1 Checksum Lo Checksum Lo 8Checksum2 Checksum Hi Checksum Hi SleepSerialNumber This puts the remotedevice into sleep mode. The remote device can only wake up with a Resetor by power cycling the 2-wire net. # Definition Sent to Remote UnitReturned to Base Unit 0 RemoteAddr Global (0x00) 0XFF 1 Command 0x16(22) 0x16 (22) 2 Arg0 Serial Number 0 Minor Version 2 Arg1 Serial Number1 Major Version 4 Arg2 Serial Mumber 2 Minor Type 5 Arg3 Serial Number 3Major Type 6 Status X Status = 1 | 64 7 Checksum1 Checksum Lo ChecksumLo 8 Checksum2 Checksum Hi Checksum Hi ReadChannelParams This reads thechannel parameters from the EEPROM and returns them. # Definition Sentto Remote Unit Returned to Base Unit 0 RemoteAddr Remote Address 0xFF 1Command 0x17 (23) 0x17 (23) 2 Arg0 X Precomp Count (# of 1.6 us) 3 Arg1X Valve On Count 4 Arg2 X Valve Off Count 5 Arg3 X Valve Startup Count 6Status X Status = 1 | 64 | 67 | 68 7 Checksum1 X Checksum Lo 8 Checksum2X Checksum Hi WriteSerialNumber Factory Only. Writes the serial numberto the remote unit that is unlocked by the UnlockRemote command. Theunit then returns to a locked state. # Definition Sent to Remote UnitReturned to Base Unit 0 RemoteAddr Global (0x00) 0xFF 1 Command 0x7F(127) 0x7F (127) 2 Arg0 Serial Number 0 Serial Number 0 3 Arg1 SerialNumber 1 Serial Number 1 4 Arg2 Serial Number 2 Serial Number 2 5 Arg3Serial Number 3 Serial Number 3 6 Status X Status = 1 | 64 | 67 | 68 7Checksum1 Checksum Lo Checksum Lo 8 Checksum2 Checksum Hi Checksum Hi

[0092] Wide-Area Messaging System

[0093]FIG. 13 shows a block diagram of the wide-area messaging system.There are many monitoring and control systems that do an adequate job inan isolated and stand-alone environment. There are many people who needto manage multiple systems at several different locations. Thisinvention allows a person to receive regular communications about thestatus of irrigation and HVAC systems at multiple locations withouthaving to visit each location to verify the systems status. At a singlelocation, a single computer (or multiple computers or controllers) willmanage the control and monitoring of a supported function likeirrigation or HVAC. These computers will report into a central computeron a regular basis with status, alerts, operational data, configurationdata, and to check for modifications to configurations or updates tosoftware. These communications will use the Internet, and will usestandard protocols with an option for encryption if the user has asecurity need. The central computer will consolidate the information andwill generate reports as configured by the user, and will distributethese reports on a regular schedule. Alerts and site errors that requireimmediate attention will generate an immediate communication. A methodof designating distribution lists for different classes of communicationwill allow messages to be directed to specific individuals or groups ofindividuals that have a business need for the report or communication.If a computer or controller fails to report as scheduled, the regularoperation report will have that indicated or optionally a specificmessage can be generated and sent to the maintenance person. The centralcomputer will also provide a HTTP connection that will allow eachauthorized person to view the consolidated data and operation reportsfor his sites and services. Through the HTTP connection and with astandard browser, changes to the operational properties for sites can bemade and then downloaded to the corresponding computers or controllersas they check in on their scheduled basis.

[0094] Remote Control

[0095]FIG. 14 shows a diagram of how a user can interact with anirrigation control computer using a standard cell phone, or other phone.The user can dial up the computer over a phone line, the computeranswers using a voice modem. The computer then instructs the user toenter a security code. Once the security code is correct, the user canexecute application specific commands using the keypad, while receivingprompts and information back in normal voice instructions. In anirrigation application, this allows a maintenance person to test zonesand other basic operations while away from the controlling computer.Several systems provide this function through keypads on specializedradios, but with the ubiquitous nature of cell phones, these provide amuch more useable and available vehicle for remote control of thesetypes of systems.

We claim:
 1. An integrated power and bi-directional data transmissionapparatus for controlling the operation of and monitoring informationfrom various electrical equipment modules in a control systemcomprising: a two-wire bus including a first line acting as a voltagesupply line and a second line, the second line is a return line forpower distribution and the second line is a return line for asynchronousdata transmission, an interface means capable of communication withindustry standard controllers including personal computers, personaldata appliances or other microprocessor based systems, a communicationprotocol defining a two-wire communication cycle wherein the powersource is configured for communication during a two-wire communicationphase and reconfigured for power delivery during the remainder of thetime, said two-wire communication phase includes: a first phase, thefirst phase is a full power phase where power is supplied for all normaloperations of the system, a second phases, the second phase is acommunication phase consisting of a reduced power phase where thecurrent is limited and the base unit initiates a command, a third phase,the third phase is a full power phase where the command is executed, afourth phase, the fourth phase is a response phase operating at reducedpower phase providing the current is limited where the remote unitresponds to the command.
 2. A system for communicating between aplurality of modules connected to a two wire bus comprising: acommunication protocol, the protocol further including a communicationstate wherein each module is capable of detecting when the two wire busis in the communication state and each module monitors the two-wire busto decode communications delivered to the module address, and acollision detection means for detecting multiple responses on the twowire bus wherein each function backs off the function's communicationattempt until only one function continues to communicate, wherein eachfunction will reliably return unique address and descriptiveinformation.